package dht;

public class Star implements java.io.Serializable {

    public int id;
    public double magnitude, period;

    // for Serializable
    private Star() { }
    
    public Star(int ID, double magnitude, double period) {
        this.id = ID;
        this.magnitude = magnitude;
        this.period = period;
    }
    
    @Override
    public boolean equals(Object other) {
        if (!(other instanceof Star))
            return false;
        
        Star otherStar = (Star)other;
        return id == otherStar.id
            && magnitude == otherStar.magnitude
            && period == otherStar.period;
    }

    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + this.id;
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.magnitude) ^ (Double.doubleToLongBits(this.magnitude) >>> 32));
        hash = 97 * hash + (int) (Double.doubleToLongBits(this.period) ^ (Double.doubleToLongBits(this.period) >>> 32));
        return hash;
    }
}